package controller;

import model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import service.UserService;

import java.util.List;

/**
 * Created by 小泽玛丽罗 on 2016/9/29.
 */
@RestController
public class IndexController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/index",method = RequestMethod.GET)
    public String index(){

        return "index";
    }

    @RequestMapping(value = "/getAll",method = RequestMethod.GET)
    public List<User> getAll(){
        return  userService.getAll();
    }
}
